package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IAgencyCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO
 *
 * @Author mr.zhao
 * @Date 2025/7/1 21:29
 */
@RestController("agencyCertificationAuditController")
@RequestMapping("/agency/agency-certification-audit")
@Api(tags = "机构端 - 提交认证相关接口")
public class AgencyCertificationAuditController {

	@Autowired
	private IAgencyCertificationService agencyCertificationService;

	@PostMapping
	@ApiOperation("提交认证申请")
	public void addCertification(@RequestBody AgencyCertificationAuditAddReqDTO dto){
		agencyCertificationService.addCertification(dto);
	}

	@GetMapping("/rejectReason")
	@ApiOperation("查询最新的驳回原因")
	public Map<String,Object> getRejectReason(){
		String reject = agencyCertificationService.getRejectReason();
		Map<String,Object> map = new HashMap<>();
		map.put("rejectReason",reject);
		return map;
	}
}
